package com.review.day02;
class Ancestors{
    private String name="祖宗";//私有属性

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
class Grandpa extends Ancestors{
    String name="爷爷";
    public void tell(){
        System.out.println("你是："+getName());
    }
}
    class Father extends Grandpa{
    String name="父亲";//假设 创建father对象 输出你是？？
    public void tell(){
        System.out.println("你是："+getName());
    }
}
public class 继承的问题1 {
    public static void main(String[] args) {
        Father f=new Father();
        f.tell();
    }
}
